﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<Beeldbankmvc.ViewModels.ReactionViewModel>" %>

<%@ Import Namespace="Beeldbankmvc.Models" %>
<%@ Import Namespace="Beeldbankmvc.Code" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">Reactie aanpassen</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <% Html.RenderAction("AdminMenu", "Miscellaneous"); %>
    <h1>Reactie aanpassen</h1>

    <div id="register">
        <% using (Html.BeginForm())
           {%>
        <%: Html.ValidationSummary(true) %>
        <% if (Model.reactionObjects.Count > 0)
           {%>
        <fieldset>
            <legend style="display: none;">Velden</legend>
            <p>
                <label for="Emailadres">
                    Emailadres</label>
                <%: Html.DisplayFor(model => model.reactionObjects[0].EmailAdres)%>&nbsp;
            </p>
            <p>
                <label for="Naam">
                    Naam</label>
                <%: Html.DisplayFor(model => model.reactionObjects[0].Naam)%>&nbsp;
            </p>
            <p>
                <label for="Naam">
                    Telefoon</label>
                <%: Html.TextBoxFor(model => model.reactionObjects[0].Telefoon)%>&nbsp;
            </p>
            <p>
                <label for="Subject">
                    Onderwerp</label>
                <%: Html.DropDownList("Subject", new SelectList(ViewData["SubjectList"] as IEnumerable, "Value", "Text", Model.reactionObjects[0].Subject))%>
                <%: Html.ValidationMessageFor(model => model.reactionObjects[0].Subject)%>
            </p>
            <p>
                <label for="Category">
                    Categorie</label>
                <%: Html.DropDownList("Category", new SelectList(ViewData["CategoryList"] as IEnumerable, "Value", "Text", Model.reactionObjects[0].Category))%>
                <%: Html.ValidationMessageFor(model => model.reactionObjects[0].Category)%>
            </p>
            <p>
                <label>
                    Status</label>
                <%: Html.DropDownList("ReactionStatuses")%>
            </p>
            <p>
                <label for="Boodschap">
                    Boodschap</label>
                <%: Html.TextAreaFor(model => model.reactionObjects[0].Boodschap,10,20,null)%>
                <%: Html.ValidationMessageFor(model => model.reactionObjects[0].Boodschap)%>
            </p>
        </fieldset>
        <p style="width: 650px;">
            <input type="submit" name="submit" class="button" value="Alleen Opslaan" /><input
                type="submit" name="submit" style="margin-right: 10px;" class="button" value="Opslaan en reactie sturen" />
        </p>
        <% }
           else
           { %>
        <div>
            Deze reactie bevat geen gegevens.</div>
        <% } %>
        <% } %>
    </div>
    <div style="width: 600px;">
        <%: Html.ActionLink("Terug", "Index") %>
    </div>
    <h2>
        Correspondentie</h2>
    <div style="width: 680px;">
        <div class="line">
            <div style="float: left; width: 130px; font-weight: bold">
                Datum
            </div>
            <div style="float: left; width: 80px; font-weight: bold">
                Categorie
            </div>
            <div style="float: left; width: 80px; font-weight: bold">
                Onderwerp
            </div>
            <div style="float: left; width: 290px; font-weight: bold">
                Boodschap
            </div>
            <div style="float: left; width: 100px; font-weight: bold">
                Status
            </div>
        </div>
        <div>
            <%
            foreach (Beeldbankmvc.Models.BEELDBANK_REACTIE_CORRESPONDENTIE reaction in Model.correspondenceObjects)
            { %>
            <%
                if (reaction.IsVisitorResponse)
                { %>
                    <div class="line" style="color: Red;">
                <%
                }
                else
                { %>
                    <div class="line">
                <%
                } %>
                        <div style="float: left; width: 130px;">
                            <%: reaction.Datum.ToString() %>&nbsp;
                        </div>
                        <div style="float: left; width: 80px;">
                            <%: IdMapper.mapReactionCategory(reaction.Category) %>&nbsp;
                        </div>
                        <div style="float: left; width: 80px;">
                            <%: IdMapper.mapReactionSubject(reaction.Subject) %>&nbsp;
                        </div>
                        <div style="float: left; width: 290px;">
                            <%: reaction.Boodschap %>&nbsp;
                        </div>
                        <div style="float: left; width: 100px;">
                            <%
                            if (reaction.BEELDBANK_REACTIESTATUS != null)
                            {%>
                                <%: reaction.BEELDBANK_REACTIESTATUS.Name %>&nbsp;
                            <%
                            } %>
                        </div>
                        <div>
                        </div>
                    </div>
                <%
            } %>
        </div>
    </div>
</asp:Content>
